Internet services provide a variety of content and functionality to users on client computers. Web browsers executing on the client computers receive, render, and display content provided by web servers running the services. An example of an Internet service is a cloud computing service that allows users to create, edit, store, and share files online. The files are stored on the cloud computing service rather than the client computers. The cloud computing service provides a user interface to the user's web browser for the display and editing of files. Files that may be stored on cloud computing services include word processing documents, spreadsheets, presentations, audiovisual files, and pictures.
Web browsers display text from content provided by web servers, such as text in files stored on a cloud computing service. The web browser receives text, and renders it for display on the display screen of the client computer. The web browser determines the layout of text on the screen, for example determining the locations in the text where line breaks should be inserted based on the font style and size of the text, the space allocated for the text, the size of the browser window, and other such constraints. The web browser processes text character by character to determine if a line break or other spacing may be inserted after such character. For example, the web browser may determine that a letter character that is followed by another letter character cannot have a line break inserted after the first letter character while a letter character followed by a space character may have a line break inserted after the letter character. However, processing text character by character to check for line break possibilities is a time consuming process, especially for large blocks of text. This produces latency in displaying text from a web server on a client computer.